(Un)Lucky Lotto
Version 2.0.3
by Dave Kalin

Introduction
(Un)Lucky Lotto is a program that allows you to play your lucky Lotto numbers over a large number of simulated lotteries. You can easily simulate years, centuries, or millenia of lotteries in just a few minutes, thus practically testing just how “lucky” your numbers are. This version of (Un)Lucky Lotto simulates the SuperLotto 6/51 currently in use in California (as of late 1996), but the principles (namely, “Don’t Play”) can be applied to any state.

History (and soapbox)
I originally wrote this program in the summer of 1991, when the Lotto jackpot in California topped $100 million. “Lotto Fever” abounded throughout the state, and people were buying dozens of tickets at a time, in order to “improve their chances”. “Lotto Pools” developed, and people were literally spending hundreds of dollars for a chance at the jackpot. Seeing these people pour their life savings into the lottery (also known as the Stupidity Tax) gave me the inspiration of writing a program that would hopefully show you, the user, just how futile and foolish it is to play. Spend your money on food or clothing, not a 1 in 18,000,000 chance of getting rich quick. The state taxes your winnings, anyway…

Instructions
To play (Un)Lucky Lotto, simply enter your favorite Lotto numbers into the Lotto  Numbers window. If you prefer, you can have numbers chosen randomly for you by selecting the “Quick Pick” item under theLotto menu. (Quick Pick is an option in the California Lottery; your state may vary).

(Un)Lucky Lotto is pre-configured for the SuperLotto 6/51 currently available in California, but you can change the parameters to fit your state's lottery via the Lotto Preferences dialog. You can also vary the number of lotteries to simulate by entering that value in the Lotto Preferences dialog. (Un)Lucky Lotto will calculate how long (in months) it would take to realistically play this many lotteries (assuming two drawings per week, as in California). 

Once you have entered your numbers, you can then start the lotto simulations by selecting the Go item under the Lotto menu. As each simulated lottery is drawn, you can see each result in the “This Lotto” portion of the main window. Each drawing is compared to your numbers, and the cumulative results are displayed in the Winnings window, along with your estimated winnings (or losses).

Finally, (Un)Lucky Lotto lets you know when you “hit the jackpot” by allowing you to set a “Jackpot Alarm”. Select “Lotto Preferences” under the Lotto menu to set the Alarm parameters. (Un)Lucky Lotto can either audibly notify you of a jackpot, or pause to let you view the results.

As a benchmark, (Un)Lucky Lotto can simulate a year’s worth of drawings in about four seconds on a Macintosh IIci. Your actual mileage may vary according to CPU and system configuration. (Hint: to make the simulations go faster, try closing the Winnings and Distribution windows) (Un)Lucky Lotto also runs in the background, so you can simulate centuries of Lottos while working on that important spreadsheet. 

Menu Reference
File Menu
New
This menu item opens a new lottery document with the current settings. It is only visible when there is no lottery currently open.

Close
This menu item closes the frontmost window. If the frontmost window is the "Lottery Numbers" window, all current statistics will be reset and the accompanying Winnings and Distribution windows will also be closed.

Quit
This quits (Un)Lucky Lotto. Duh… 

Everything else
All of the other menu items under the File menu (saving, printing, etc.) have been disabled pending further public interest. If you’d like to see these features, please send in your shareware fees to get me motivated.

Edit Menu
Lotto Preferences
The Lotto Preferences dialog is where you can edit all sorts of parameters for the current lottery. 

Number of Lottos
Here is where you can modify the number of simulated lotteries for your numbers. (Un)Lucky Lotto will calculate how long (in months) it would take to realistically play this many lotteries (assuming two drawings per week, as in California).

Number of Balls
Number of Picks
These two scrollbars allow you to modify the lotto parameters for another state's game. The range of possible values for balls is 1 to 60, and for picks is 1 to 6.  That should  cover all US states' games— please let me know if any game falls outside this range.

Beep (Jackpot alarm)
Pause (Jackpot Alarm)
By selecting these checkboxes, you can have (Un)Lucky Lotto automatically notify you when a certain threshhold is met (default is 4 out of 6 hits).

Repeating Numbers
As of version 2.0.3, this does nothing, because I didn't feel like implementing it yet. If it were working, it would allow numbers to be "thrown back in" after being picked, thus allowing numbers to be picked multiple times. This feature is used in some lottery games, such as California's Decco game. If you'd like to see this feature implemented, please send in your shareware fees to get me motivated.

Money Values
This will allow you to enter imaginary values to see how much money you would win (or lose) if you were using actual money. While the dialog has entries for up to six hits, the numbers for your state may vary.  

Please note that most states pay off their winner using a parimutuel formula (i.e., not a fixed amount), so the values entered here are approximate at best. The default values are estimates assuming a $12 million jackpot and California's formula for determining sub-jackpot pools , so feel free to adjust the figures according to this week's Lotto activity.

Everything else
All of the other menu items under the Edit menu do as you’d expect. For more information about these menu items, consult the “Macintosh Basics” section of your owner’s manual.

Lotto Menu
Go
This will start (or continue) a lottery sequence. It is only available when there is a lottery window open and lottery numbers have been chosen.

Stop
This will pause the current lottery sequence. Press Go under the Lotto Menu to continue the lottery sequence.

Step
This will let you step through the lottery sequence one lotto at a time, thus allowing you to see each lotto at a normal pace. 

Quick Pick
Most states offer a “Quick Pick” option which automatically picks random numbers for you to use. These numbers are theoretically no better or worse than any specific numbers, but it offers an alternative to choosing the birthdates of your family or your “lucky numbers” each time. Quick Pick is only available for new lottery sequences.

Theoretical Values
This will present a dialog that computes the actual odds of winning the lottery. It is pre-configured for California’s SuperLotto 6/51, but is configurable for any state’s lottery system. 

Windows Menu
Lotto Numbers
This menu item shows and hides the window that displays your lottery numbers, the current lottery picks, and the progress in this lottery sequence. Selecting this menu item does not stop a running lottery sequence; it merely hides the window. To close the entire lottery sequence, close this window via the close box or the File menu. 

Hiding the Distribution and Winnings windows usually makes the lottery sequence go much quicker.  

Winnings
This menu item shows and hides the window that displays the running total of hits, as well as your estimated winnings (or losses) as entered in the Money Values dialog.. 

Selecting this menu item does not stop a running lottery sequence; it merely hides the window. To close the entire lottery sequence, close the Lottery Numbers window via the close box or the File menu. 

Distribution
This menu item shows and hides the window that displays the frequency distribution of all numbers in the current lottery sequence. This shows what numbers have been "hot" or "cold", but is still no indicator of future drawings.
Selecting this menu item does not stop a running lottery sequence; it merely hides the window. To close the entire lottery sequence, close the Lottery Numbers window via the close box or the File menu. 

Miscellany
• Things run faster if you close some of the accompanying windows (such as Winnings or Distribution)
• Sorting your lottery numbers also makes the lottery run faster
• While many people claim that QuickPick works better, you will find that any numbers will produce the same statistical result.
• Check out the icon’s Balloon Help…
• This program was written solely in Pascal, the language of champions. Yes, there are still a few of us Pascal guys left…

Change Log

Changes from version 1.0
Speed greatly improved
New re-seeding algorithm for better random numbers
Separate windows for Lotto numbers and running totals
Edit lottery settings for different states' games
Frequency distribution window
Winnings window
Theoretical values
Money values dialog to estimate winnings

Changes from version 2.0.1
Removed the double-Apple menu (too bad, because I thought it was fun)
Error-checking on duplicate and out-of-range entries
Various little bug fixes and window updates
Jackpot sound 

Changes from version 2.0.2
Corrected crashes on certain non-FPU machines
Correct "double Go" bug 

Shareware Notice
Hopefully, this program will have shown you that playing the Lottery is a futile and foolish thing to do, and your hard-earned money can be spent on better things (such as Shareware registrations!). If (Un)Lucky Lotto helps you kick the Lotto habit, please send a small portion of your estimated savings to:

Dave Kalin
637 Westholme Av.
Los Angeles, CA 90024

Suggested donation is $15 if you save $50 per year. Please be sure to include your e-mail address (if you have one) so I can thank you electronically. I can be reached at the following electronic mail addresses (as of 10/1/96):

America Online: 	MacDude
InterNet: 		macdude@aol.com

I welcome any comments or suggestions you may have to offer. Here are some ideas that I have for version 3.0, so let me know if you’d like me to continue. 
Printing, saving, etc.
Non-integer money values (i.e., 75¢)
Lotto wheeling
"Number-box" type lotteries (Daily 3 in California)
Repeating-number lotteries (Decco in California)
Keno type lotteries
Error-checking for entries
Parimutuel betting over a network
Statistical functions (expected value, standard deviation, etc.)
Play sound files associated with jackpot

Happy Lotto-ing, and go buy yourself something nice with the money you’ve saved. You earned it…

© 1991-96 by Dave Kalin. All rights reserved. This program may be freely distributed and used within a 15-day trial period. After the trial period, the user must either remit a shareware fee (noted above) or delete the program. Inclusion of this program (and its accompanying documentation) on any commercial compilation must be approved by the author. 

This program carries the "All Mac" Seal of Approval:  No Microsoft products of any kind were used in the development or distribution of this program and its supporting documentation. So there.